let mapleader=" "
let g:EasyMotion_do_mapping=0

set easymotion
set keep-english-in-normal

nnoremap <Space>rn :action RenameElement<cr>
nnoremap z9 :action Debug<cr>
nnoremap zm :action ToggleLineBreakpoint<cr>
nnoremap zz :action ShowExecutionPoint<cr>
nnoremap ze :action StepOver<cr>
nnoremap zi :action StepInto<cr>
nnoremap zu :action StepOut<cr>
map s <Plug>(easymotion-sn)
" nnoremap <A-r> :source C:\Users\zhuni\AppData\Local\nvim\idea.vim<cr>
nnoremap <A-r> :source ~/.config/nvim/idea.vim<cr>
nnoremap <Space>rc :source ~/.config/nvim/idea.vim<cr>
" nnoremap <A-r> :action IdeaVim.ReloadVimRc.reload<cr>
" nnoremap <Esc> <Esc>:nohl<cr>:action CloseActiveTab<cr>
nnoremap <Esc> <Esc>:nohl<cr>
nnoremap X :action ReopenClosedTab<cr>
nnoremap <A-p> :action PinActiveTabToggle<cr>
nnoremap m :action ToggleBookmark<cr>
nnoremap M :action ShowBookmarks<cr>
inoremap <A-e> :action ExpandLiveTemplateCustom<cr>
nnoremap <Space>pp :action CloseAllUnpinnedEditors<cr>
nnoremap <Space>sc :action ActivateSciViewToolWindow<cr>
nnoremap tt :action SearchEverywhere<cr>
nnoremap <Space>nn :action Build<cr>
nnoremap <Space>ne :action Run<cr>
nnoremap <Space>ee :action RunClass<cr>
nnoremap <Space>py :action com.jetbrains.python.console.RunPythonOrDebugConsoleAction<cr>
noremap <A-k> :action CommentByLineComment<cr>
vnoremap <A-k> :action CommentByLineComment<cr>
nnoremap <C--> :action EditorDecreaseFontSize<cr>
nnoremap <C-=> :action EditorIncreaseFontSize<cr>

set timeoutlen=3000
set scrolloff=99
set sidescrolloff=6
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
set number
set relativenumber
set showcmd
set noshowmode
set hlsearch
let loaded_matchparen = 0
set incsearch
set ignorecase
set smartcase
set clipboard+=unnamed,unnamedplus
set clipboard+=unnamedplus
set visualbell

noremap b B
noremap B b
noremap w W
noremap W w
" noremap  <A-u> {
" noremap  <A-e> }
noremap ]p p
noremap p ]p


source ~/.config/nvim/qwer.vim

" old colemak key
" noremap n h
" noremap N ^
" noremap I $
" noremap i l
" noremap h i
" noremap u k
" noremap <A-u> <nop>
" nnoremap U 10k
" vnoremap U 3k
" noremap e j
" noremap <A-e> <nop>
" nnoremap E 10j
" vnoremap E 3j
" noremap H I

noremap <LEADER>ay ggyG
noremap <LEADER>ad ggdG
noremap <LEADER>ap ggVGP
noremap <LEADER>qn @n
noremap @ @n
noremap <LEADER>e :e!<CR>
noremap <A-f> /
imap tn<SPACE> >++>
nnoremap <LEADER><LEADER> <Esc>/>++><CR>c4l
" noremap   <A--> <C-o>
nnoremap <silent> <space>oo :!st -e sh -c 'nvim %'<cr>
nnoremap - <C-o>
" noremap   <A-=> <C-i>
" nnoremap == <C-i>
nnoremap = <C-i>
cnoremap <A-f> /
inoremap <A-o> <nop>
" inoremap <A-e> <nop>
" noremap si :set splitright<CR>:vsplit<CR>
" noremap sn :set nospr<CR>:vsplit<CR>
" noremap se :set splitbelow<CR>:split<CR>
" noremap su :set nosplitbelow<CR>:split<CR>
noremap <LEADER>ta :tabe<CR>
nnoremap <A-n> :-tabnext<CR>
nnoremap <A-i> :+tabnext<CR>
inoremap <A-i> <Right>
inoremap <A-n> <Left>

nnoremap <A-q> :q!<CR>
nnoremap <A-w> :w<CR>
noremap ? *
" noremap! <A-w> <Esc>:w<CR>
inoremap <C-u> <up>
inoremap <C-e> <down>
" noremap!   <Esc>
noremap <A-o> o<Esc>O
nnoremap > >>
nnoremap < <<
nnoremap <LEADER>d <C-]>
" fold and unfold {{{
noremap <LEADER>o za

" register yank and paste {{{
noremap <LEADER>pn "np
noremap <LEADER>pe "ep
noremap <LEADER>pi "ip
vnoremap <LEADER>yn "ny
vnoremap <LEADER>ye "ey
vnoremap <LEADER>yi "iy
vnoremap  <Esc>
" }}}


inoremap tnq ~
inoremap tna 1
inoremap tnr 2
inoremap tns 3
inoremap tnt 4
inoremap tnd 5
inoremap tnh 6
inoremap tnn 7
inoremap tne 8
inoremap tni 9
inoremap tno 0
inoremap tnA !
inoremap tnR @
inoremap tnS #
inoremap tnT $
inoremap tnD %
inoremap tnH ^
inoremap tnN &
inoremap tnE *
inoremap tnI (
inoremap tnO )
inoremap aoa !
inoremap aor @
inoremap aos #
inoremap aot $
inoremap aod %
inoremap aoh ^
inoremap aon &
inoremap aoe *
inoremap aoi (
inoremap aoo )
inoremap tn<Enter> \n
inoremap <A-l> ()<left>
inoremap <A-u> []<left>
inoremap <A-y> <end>{}<left>
inoremap tnl ()<left>
inoremap tnu []<left>
inoremap tny <end><space>{}<left>
inoremap tnY {}<left>
